import { createStore } from "vuex";
import user from '@/store/modules/user.js'

const store = createStore({
    modules:{
        user
    },
    state: {
        routeLoaded: false,
        firstRoute: null,
        menuTree: null
    },
    mutations: {
        setRouteLoaded(state, loaded) {
            // 设置路由是否加载完成
            state.routeLoaded = loaded;
        },
        setFirstRoute(state, route) {
            state.firstRoute = route;
        },
        setMenuTree(state, data) {
            state.menuTree = data;
        }
    }
})
export default store